package com.tongji.seller.utils
{
	import flash.display.Loader;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.ProgressEvent;
	
	import mx.core.UIComponent;
	
	import spark.components.Image;
	
	
	/**
	 *caddy
	 *2012-1-5
	 *
	 */
	public class TestImage extends UIComponent
	{
		[Embed(source="assets/images/loading.swf")]
		private var EmbedLoading:Class;
		
		private var loadingMC:MovieClip;
		private var loader:Loader;
		
		public var source:String;

		public var image:Image;
		public function TestImage()
		{
			loadingMC = new EmbedLoading();
			loadingMC.x = 15;
			loadingMC.y = 5;
			this.addChild(loadingMC);
			super();
		}
		
		protected function onProgressHandler(event:ProgressEvent):void
		{
			
			image.addEventListener(Event.COMPLETE, onCompleteHandler);
		}
		
		protected function onCompleteHandler(event:Event):void
		{
			this.removeChild(loadingMC);
		}
	}
}